02. Additional Project Details

Additional Project Details

Highway Parameters

In highway.h there are a number of parameters that can be modified to help with testing and understanding.

// Parameters 
// --------------------------------
// Set which cars to track with UKF
std::vector<bool> trackCars = {true,true,true};
// Visualize sensor measurements
bool visualize_lidar = true;
bool visualize_radar = true;
bool visualize_pcd = false;
// Predict path in the future using UKF
double projectedTime = 0;
int projectedSteps = 0;
// --------------------------------

The trackCars list can be used to toggle on/off cars for the UKF objects to track. The default is to track all three cars on the road, but for testing it can be nice to toggle to only track one at a time. For instance to only track the first car {true,false,false} .

Projecting the UKF path 2 seconds into the future.

Projecting the UKF path 2 seconds into the future.

The animation above shows what it looks like if the projectedTime and projectedSteps variables are used. Also in the animation above the visualization for lidar and radar has been set to false and projectedTime = 2 and projectedSteps = 6 . The green spheres then show the predicted position for the car in the future over a 2 second interval. The number of steps increases the number of positions to interpolate the time interval.

It's interesting to see the predicted path which is constrained by the motion model. In this project the motion model used is CTRV, which assumes constant velocity and turning rate. Since our cars do not have constant turning rates you can see the predicted paths swing around and take a while to correct after the car begins moving straight again.

Visualizing high resolution point cloud data for traffic.

Visualizing high resolution point cloud data for traffic.

The visualize_pcd parameter can be set to true to visualize the cars from the lidar's perspective from point clouds. The traffic pcd data is available in src/sensors/data/pcd directory. As a bonus assignment this data could be used to cluster the individual cars using techniques from Lidar Obstacle Detection and then bounding boxes could be fitted around the car clusters. The bounding box center (x,y) point could then be used to represent the lidar marker that would be fed into the UKF instead of the project pre-generated lidar marker from tools.cpp lidarSense function.